package com.example.common.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.common.system.dao.MenuDao;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.common.util.PageUtils;

import com.example.common.system.dao.MenuDao;
import com.example.common.system.entity.MenuEntity;
import com.example.common.system.service.MenuService;


@Service("menuService")
public class MenuServiceImpl extends ServiceImpl<MenuDao, MenuEntity> implements MenuService {

    @Override
    public PageUtils queryPage(Page<MenuEntity> page, MenuEntity menuEntity) {
        IPage<MenuEntity> result = this.page(page, new QueryWrapper<MenuEntity>(menuEntity));

        return new PageUtils(result.getRecords(),
                result.getTotal(),
                result.getSize(),
                result.getPages());
    }

}